1 Public Class FrmDEFFECTIVE_STOCKS_LIST
2
3     Private Sub cmdcancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdcancel.Click
4         Me.Close()
5     End Sub
6
7     Private Sub FrmDEFFECTIVE_STOCKS_LIST_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
8         
' MsgBox("A")
9         sqlSTR =
"SELECT TBL_Purchase_Detail.Item_ID as 'ID', TBL_Purchase_Detail.Purchase_Detail_ID as 'Detail ID', Replace(Replace(TBL_Category_Item_File.Item_Name,'$.$',''''),'$..$',',') as 'Name', TBL_Category_Item_File.Item_Description as 'Description / Item Number', TBL_Purchase_Detail.Item_Price as 'Price', TBL_Category_Item_File.Item_Barcode as 'Barcode', TBL_Purchase_Detail.Item_QTY as 'Quantity', TBL_Purchase_Detail.Unit_Measure as 'Measure'" & _
10                  
" FROM TBL_Purchase_Detail INNER JOIN TBL_Category_Item_File ON TBL_Purchase_Detail.Item_ID = TBL_Category_Item_File.Item_ID " & _
11                  
" WHERE TBL_Purchase_Detail.Purchase_ID = " & FrmDEFFECTIVE_STOCKS_ADD.txtpo2.Text
12         FillListView(ExecuteSQLQuery(sqlSTR), lstitems,
1)
13     End Sub
14
15     Private Sub cmdselect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdselect.Click
16         
'With FrmDEFFECTIVE_STOCKS_ADD
17         
' .lstitems.Items.Add(Me.lstitems.FocusedItem.Text)
18         
' .lstitems.Items(.lstitems.Items.Count - 1).SubItems.Add(Me.lstitems.FocusedItem.SubItems(1).Text)
19         
' .lstitems.Items(.lstitems.Items.Count - 1).SubItems.Add(Me.lstitems.FocusedItem.SubItems(2).Text)
20         
' .lstitems.Items(.lstitems.Items.Count - 1).SubItems.Add(Me.lstitems.FocusedItem.SubItems(3).Text)
21         
' .lstitems.Items(.lstitems.Items.Count - 1).SubItems.Add(Me.lstitems.FocusedItem.SubItems(4).Text)
22         
' .lstitems.Items(.lstitems.Items.Count - 1).SubItems.Add(Me.lstitems.FocusedItem.SubItems(6).Text)
23         
' .lstitems.Items(.lstitems.Items.Count - 1).SubItems.Add("")
24         
' .lstitems.Items(.lstitems.Items.Count - 1).SubItems.Add(Me.lstitems.FocusedItem.SubItems(7).Text)
25         
' End With
26         With FrmDEFFECTIVE_STOCKS_DATA_ADD
27             If Me.lstitems.Items.Count >
0 Then
28                 Me.lstitems.Focus()
29                 .txtid.Text = Me.lstitems.FocusedItem.Text
30                 .txtdtl.Text = Me.lstitems.FocusedItem.SubItems(
1).Text
31                 .txtname.Text = Me.lstitems.FocusedItem.SubItems(
2).Text
32                 .txtdesc.Text = Me.lstitems.FocusedItem.SubItems(
3).Text
33                 .txtprice.Text = Me.lstitems.FocusedItem.SubItems(
4).Text
34                 .txtbarcode.Text = Me.lstitems.FocusedItem.SubItems(
5).Text
35                 .txtqty.Text = Me.lstitems.FocusedItem.SubItems(
6).Text
36                 .txtunit.Text = Me.lstitems.FocusedItem.SubItems(
7).Text
37             End If
38         End With
39         Me.Close()
40     End Sub
41 End Class


Gõ tìm kiếm nhanh...